<button class="layui-btn layui-btn-primary selects" style="display: [display];">
	[title]
	<i class="layui-icon layui-icon-down layui-font-12"></i>
</button>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'contlist', 'table'], function(){
        var table = layui.table;
        var $ = layui.$;
        var form = layui.form;
        var pathid=0;
        var id=[id];
        var gotoID="[gotoID]";
        var bindID="[bind]";
        var gotoStr="[gotoStr]";
        $("#"+bindID).click(function (){
            $(".selects").trigger("click")
		})
        $(".selects").click(function (){
            layer.open({
                type: 2
                ,title: '选择分类'
                ,content: '/includes/selects?id='+id
                ,btn: ['确定', '取消']
                ,area: ['30%', '40%']
                ,yes: function(index, layero){
                    var othis = layero.find('iframe').contents().find("#layuiadmin-app-form-tags")
                        ,selected = othis.find('input[name="selected"]').val()
                        ,selectedID = othis.find('input[name="selectedID"]').val()
                    $("#"+gotoID).val(selectedID)
                    $("#"+gotoStr).val(selected)
                    layer.close(index);
                }
            });
		})
    });
</script>